﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace NewProcessGuarder.converter
{
    public class ImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var val = new object();
            bool result = Boolean.Parse(value.ToString()) ? 
                util.ResourceHelper.Instance.Pg_Resources.TryGetValue("btnStop",out val) :
                util.ResourceHelper.Instance.Pg_Resources.TryGetValue("btnStart", out val) ;
            return (System.Windows.Media.ImageSource)val;
        }
        
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
